package org.jinyan.quartz.example4;

import java.util.Map;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class ColorJob implements Job {

	public static String FAVORITECOLORKEY = "fck";
	public static String CountKey = "ck";
	private static int count = 0;

	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		Map temp = context.getJobDetail().getJobDataMap();
		String favoriteColor = (String) temp.get(FAVORITECOLORKEY);
		if("red".equals(favoriteColor)){
			count++;
		}else{
			count--;
		}
		

		System.err.println(favoriteColor);
		System.err.println(count + "_____" + temp.get(CountKey));
	}
}
